package com.javafactroy.kunlong.data.valueobj;


import com.google.common.collect.BiMap;
import com.google.common.collect.HashBiMap;
import lombok.Data;

/**
*  @author raymond.lei@163.com
*  @date   2024-04-07 21:27:00

*/
@Data
public class EmployeeMetadata {
    /*表名*/
    String tableName;
    String tableComment;
    // 主键
    String pkeyField;
    // 属性与列关系
    BiMap<String, String> prop2ColMap;

    public EmployeeMetadataDict() {

        tableName = "employee";
        tableComment = "";
        pkeyField = "id";

        prop2ColMap = HashBiMap.create();
        //prop2ColMap.put();
        //		prop2ColMap.put("id","id");
		prop2ColMap.put("departmentId","department_id");
		prop2ColMap.put("name","name");
		prop2ColMap.put("gender","gender");
		prop2ColMap.put("birthday","birthday");
		prop2ColMap.put("idCard","id_card");
		prop2ColMap.put("wedlock","wedlock");
		prop2ColMap.put("nationId","nation_id");
		prop2ColMap.put("nativePlace","native_place");
		prop2ColMap.put("politicId","politic_id");
		prop2ColMap.put("email","email");
		prop2ColMap.put("phone","phone");
		prop2ColMap.put("address","address");
		prop2ColMap.put("jobLevelId","job_level_id");
		prop2ColMap.put("posId","pos_id");
		prop2ColMap.put("engageForm","engage_form");
		prop2ColMap.put("tiptopDegree","tiptop_degree");
		prop2ColMap.put("specialty","specialty");
		prop2ColMap.put("school","school");
		prop2ColMap.put("beginDate","begin_date");
		prop2ColMap.put("workState","work_state");
		prop2ColMap.put("code","code");
		prop2ColMap.put("contractTerm","contract_term");
		prop2ColMap.put("conversionTime","conversion_time");
		prop2ColMap.put("notWokDate","not_wok_date");
		prop2ColMap.put("beginContract","begin_contract");
		prop2ColMap.put("endContract","end_contract");
		prop2ColMap.put("workAge","work_age");
		prop2ColMap.put("workId","work_id");
    }

    public String prop2Col(String prop) {
        return prop2ColMap.get(prop);
    }

    public String col2Prop(String prop) {
        return prop2ColMap.inverse().get(prop);
    }

}
